package com.example.competitionregistration.mapper;

import com.example.competitionregistration.controller.dto.UserDto;
import com.example.competitionregistration.entity.Admin;
import com.example.competitionregistration.entity.InstructorAccount;
import com.example.competitionregistration.entity.StudentAccount;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @Author QuanJingFang
 * @Description //TODO 登录数据操作层，查找用户是否存在
 * @Date 2023/7/17 21:31
 **/
@Mapper
public interface LoginMapper {
    @Select("select * from student_account where account=#{account} and password=#{password}")
    StudentAccount studentLogin(UserDto userDto);

    @Select("select * from instructor_account where account=#{account} and password=#{password}")
    InstructorAccount teacherLogin(UserDto userDto);

    @Select("select * from admin where account=#{account} and password=#{password}")
    Admin adminLogin(UserDto userDto);
}
